package tests;

import visualisationRadar.VisualisationRadar;
import metiers.Echelle;
import metiers.Mire;

public class MireTest {
	
	/**Tests*/
	public static void main(String[] args) {
		System.out.println("MireTest");
		
		/**Test sur les valeurs de libelleEchelle en fonction du type*/
		VisualisationRadar.repertoire = MainProgram.path;
		VisualisationRadar.repertoireRessources = VisualisationRadar.repertoire + "ressources/";
		Echelle echelleTest = Echelle.getInstance();
		int typeTest = 1;
		echelleTest.setEchelle(typeTest);
		Mire mireTest = Mire.getInstance();
		mireTest.setMire(echelleTest, typeTest);
		String[] libelleEchelleTest = mireTest.getLibelleEchelle();
		if (libelleEchelleTest.length == 16 && libelleEchelleTest[0].compareTo("0.0") == 0 && 
				libelleEchelleTest[15].compareTo("50.0") == 0)
			System.out.println("MireTest 1/4 : ok");
		else
			System.err.println("MireTest 1/4 : erreur");
		
		typeTest = 2;
		echelleTest.setEchelle(typeTest);
		mireTest.setMire(echelleTest, typeTest);
		libelleEchelleTest = mireTest.getLibelleEchelle();
		if (libelleEchelleTest.length == 16 && libelleEchelleTest[0].compareTo("  0") == 0 && 
				libelleEchelleTest[15].compareTo("  100") == 0)
			System.out.println("MireTest 2/4 : ok");
		else
			System.err.println("MireTest 2/4 : erreur");
		
		typeTest = 3;
		echelleTest.setEchelle(typeTest);
		mireTest.setMire(echelleTest, typeTest);
		libelleEchelleTest = mireTest.getLibelleEchelle();
		if (libelleEchelleTest.length == 16 && libelleEchelleTest[0].compareTo("0.0") == 0 && 
				libelleEchelleTest[15].compareTo("150.0") == 0)
			System.out.println("MireTest 3/4 : ok");
		else
			System.err.println("MireTest 3/4 : erreur");
		
		typeTest = 4;
		echelleTest.setEchelle(typeTest);
		mireTest.setMire(echelleTest, typeTest);
		libelleEchelleTest = mireTest.getLibelleEchelle();
		if (libelleEchelleTest.length == 16 && libelleEchelleTest[0].compareTo("  0") == 0 && 
				libelleEchelleTest[15].compareTo("  100") == 0)
			System.out.println("MireTest 4/4 : ok");
		else
			System.err.println("MireTest 4/4 : erreur");
		System.out.println("MireTest fin\n");
	}
}
